package priv.yiyuan.example.design;

/**
 * 图形
 * <p>
 * 桥接模式(抽象部分)/组合模式(组件)
 */
public abstract class Shape {

    protected Renderer renderer;

    public Shape(Renderer renderer) {
        this.renderer = renderer;
    }

    public void setRenderer(Renderer renderer) {
        this.renderer = renderer;
    }

    public abstract void draw();

    public void add(Shape shape) {
        throw new UnsupportedOperationException("方法未实现！");
    }

    public void remove(Shape shape) {
        throw new UnsupportedOperationException("方法未实现！");
    }

    public void getChild(int i) {
        throw new UnsupportedOperationException("方法未实现！");
    }
}
